<template>
	<!-- 问题五 -->
		<a-modal
			title="详情"
			:width="1200"
			:visible="visible"
			:confirmLoading="confirmLoading"
			:footer="null"
			:maskClosable="false"
			@cancel="handleCancel"
		>
			<a-spin :spinning="confirmLoading">
				<a-form :form="form">
					<a-row>
						<a-col :span="12">
							<a-form-item
								label="生产单号"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['orderNumber']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="国家"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['country']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="下发时间"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['issueTime']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="预计完成时间"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['estimateCompletionTime']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="归属子公司"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['orgName']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="是否是海外仓"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input 
									disabled 
									placeholder="空" 
									:value="record.isOverseasStore=='Y' ? '是' : record.isOverseasStore=='N' ? '否' : '--'"
								/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="接收时间"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['receiveTime']"/>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="创建时间"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
								<a-input disabled placeholder="空" v-decorator="['createTime']"/>
							</a-form-item>
						</a-col>
						<a-col :span="24">
							<a-form-item
								label="备注"
								:labelCol="labelColBlock"
								:wrapperCol="wrapperColBlock"
								has-feedback=""
							>
								<div style="width: 100%;height: 100px;border: 1px solid #888;border-radius: 5px;overflow: auto;padding: 5px" v-html="record.remark"></div>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item
								label="状态"
								:labelCol="labelCol"
								:wrapperCol="wrapperCol"
								has-feedback=""
							>
							<a-tag
								style="width:70px; text-align: center;"
								:color="record.status==1 ? 'blue' :
									record.status==2 ? 'orange' :
									record.status==3 ? 'green' :
									record.status==4 ? 'pink' :
									''"
							>
								{{ 
									record.status==1 ? '生产中' :
									record.status==2 ? '入库中' :
									record.status==3 ? '未核算' :
									record.status==4 ? '已核算' :
									''
								}}
							</a-tag>
							</a-form-item>
						</a-col>
					</a-row>
				</a-form>
			</a-spin>
		</a-modal>
	</template>
	
	<script>
	export default {
		data() {
			return {
				record: {},
				labelCol: {
					xs: {span: 24},
					sm: {span: 6}
				},
				wrapperCol: {
					xs: {span: 24},
					sm: {span: 15}
				},
				labelColBlock: {
					xs: {span: 24},
					sm: {span: 3}
				},
				wrapperColBlock: {
					xs: {span: 24},
					sm: {span: 20}
				},
				record:{},
				visible: false,
				confirmLoading: false,
				form: this.$form.createForm(this),
			}
		},
		methods: {
			init(record) {
				this.visible = true
				
				this.$nextTick(()=>{
					console.log('record',record)
					this.record = record
					this.form.setFieldsValue(record)
				})
			},
			handleCancel() {
				this.form.resetFields()
				this.visible = false
				this.record = {}
			},
		}
	}
	</script>
	